<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE html>
<html lang="en">
	<head>
		<base href="<%=basePath%>">
		<meta charset="utf-8" />
		<title></title>
        <link href="static/css/bootstrap.min.css" rel="stylesheet" />
 		<link href="static/css/bootstrap-responsive.min.css" rel="stylesheet" />
		<link rel="stylesheet" href="static/css/font-awesome.min.css" />
		<!-- 下拉框 -->
		<link rel="stylesheet" href="static/css/chosen.css" />

		<link rel="stylesheet" href="static/css/ace.min.css" />
		<link rel="stylesheet" href="static/css/ace-responsive.min.css" />
		<link rel="stylesheet" href="static/css/ace-skins.min.css" />

		<link rel="stylesheet" href="static/css/datepicker.css" />
		<!-- 日期框 -->
		<script type="text/javascript" src="static/js/jquery-1.7.2.js"></script>
		<script type="text/javascript" src="static/js/jquery.tips.js"></script>
		<script type="text/javascript">
	//保存
	function save() {
		if ($("#uid").val() == "") {

			$("#uid").tips({
				side : 3,
				msg : '输入id号',
				bg : '#AE81FF',
				time : 3
			});

			$("#uid").focus();
			return false;
		}
		if ($("#uname").val() == "") {

			$("#uname").tips({
				side : 3,
				msg : '输入用户名',
				bg : '#AE81FF',
				time : 3
			});
			$("#uname").focus();
			return false;
		}
		if ($("upassword").val() == "") {

			$("#upassword").tips({
				side : 3,
				msg : '输入密码',
				bg : '#AE81FF',
				time : 3
			});
			$("#upassword").focus();
			return false;
		}
		if($("#upassword").val()!=$("#ckpw").val()){
			
			$("#ckpw").tips({
				side:3,
	            msg:'两次密码不相同',
	            bg:'#AE81FF',
	            time:3
	        });
			
			$("#ckpw").focus();
			return false;
		}
		if ($("#utel").val() == "") {

			$("#utel").tips({
				side : 3,
				msg : '输入电话号码',
				bg : '#AE81FF',
				time : 3
			});
			$("#utel").focus();
			return false;
		}
		if ($("#role_id").val() == "") {

			$("#role_id").tips({
				side : 3,
				msg : '输入角色名',
				bg : '#AE81FF',
				time : 3
			});
			$("#role_id").focus();
			return false;
		}
		
		
		$("#Form").submit();
		$("#zhongxin").hide();
		$("#zhongxin2").show();
	}
	function addInco(){
		
		
	}
</script>
</head>
<body>

	<form action="user/${msg }.do" name="Form" id="Form" method="post">
	 <div id="zhongxin">
		<table id="table_report"
				class="table table-striped table-bordered table-hover">
			<tr>
				<td><input type="text" name="uid" id="uid" value="${pd.uid}" maxlength="32" placeholder="这里输入ID号"/></td>
			</tr>
			<tr>
				<td><input type="text" name="uname" id="uname" value="${pd.uname}" maxlength="32" placeholder="这里输入用户名"/></td>
			</tr>
			<tr>
				<td><input type="password" name="upassword" id="upassword" maxlength="32" placeholder="密码"/></td>
			</tr>
			<tr>
				<td><input type="password" name="ckpw" id="ckpw" maxlength="32" placeholder="确认密码"/></td>
			</tr>
			<tr>
				<td><input type="text" name="utel" id="utel" value="${pd.utel}" maxlength="32" placeholder="这里输入电话"/></td>
			</tr>
			<tr>
				<td><input type="text" name="uemail" id="uemail" value="${pd.uemail}" maxlength="32" placeholder="这里输入Email"/></td>
			</tr>
			<tr>
			<!-- <c:forEach items="${roleList}" var="role">
					<c:if test="${role.role_id == pd.role_id }">
						<td><input type="text" name="role_name" id="role_name" value="${role.role_name }" maxlength="32"/></td>
					</c:if>
					<c:if test="${role.role_id == null }">
						<td><input type="text" name="role_name" id="role_name" maxlength="32" placeholder="这里输入角色名"/></td>
					</c:if>
			 </c:forEach>
			          data-placeholder没有显示
			  --> 
			 <td>
			 	<select name="role_id" id="role_id" data-placeholder="请选择职位" style="vertical-align:top;">
				<option value=""></option>
				<c:forEach items="${roleList}" var="role">
					<option value="${role.role_id }" <c:if test="${role.role_id == pd.role_id }">selected</c:if>>
					${role.role_name }
					</option>
				</c:forEach>
				</select>
			 </td>
			 
			</tr>
			
			
			<tr>
				<td style="text-align: center;" colspan="10">
				<a	class="btn btn-mini btn-primary" onclick="save();">保存</a> 
				<a	class="btn btn-mini btn-danger" onclick="top.Dialog.close();">取消</a>
				</td>
			</tr>
		</table>
		</div>
		<div id="zhongxin2" class="center" style="display:none"><br/><br/><br/><br/><br/><img src="static/images/jiazai.gif" /><br/><h4 class="lighter block green">提交中...</h4></div>
	</form>
	
	<script type="text/javascript">window.jQuery || document.write("<script src='static/js/jquery-1.9.1.min.js'>\x3C/script>");</script>
		<script src="static/js/bootstrap.min.js"></script>
		<script src="static/js/ace-elements.min.js"></script>
		<script src="static/js/ace.min.js"></script>
		

</body>
</html>